package com.ting.rss.util;

import java.io.InputStream;

import android.os.Environment;
import android.os.Vibrator;

import com.ting.rss.R;

public class Prop {
	
	
	
//	private static boolean isAutoNightMode = true;
//	private static boolean isNightMode = false;
//	private static boolean isGodMode = false;
	
	
	private static boolean isChangedNightMode = false;
	private static boolean isConnectToNet = true;
	
	
	public static int mainLayout = R.layout.main; 
	public static int newsListLayout = R.layout.item;
	public static int contentLayout = R.layout.content;
	
	public static String backgroundColor = "#FFFFFF";
	public static String textColor = "#000000";
	
	public static InputStream cssInputStream;
	
	public static String SDRoot = Environment.getExternalStorageDirectory().getAbsolutePath();
	public static Vibrator shake;
	
	public static String css;
	
	
	
	
	public static boolean isNightMode() {
//		System.out.println("night mode id :" + Init.share.getBoolean("NightMode", false));
		return Init.share.getBoolean("NightMode", false);
	}
	
	
	public static void setNightMode(boolean isNightMode) {
		Init.editor.putBoolean("NightMode", isNightMode).commit();
//		Prop.isNightMode = isAutoNightMode; 
		
		
		
		setChangedNightMode(true);
		if(isNightMode == true){
			mainLayout = R.layout.night_main;
			newsListLayout = R.layout.night_item;
			backgroundColor = "#000000";
			textColor = "#595959";
		}else {
			mainLayout = R.layout.main; 
			newsListLayout = R.layout.item;
			backgroundColor = "#FFFFFF";
			textColor = "#000000";
		}
	}


	public static boolean isGodMode() {
		if(Init.share.getInt("money", 5) >=0 ){
			return true;
		}else{
			return false;
		}
	}


	public static void setGodMode(boolean isGodMode) {
		Init.editor.putBoolean("GodMode", isGodMode).commit();
//		Prop.isGodMode = isGodMode;
		if(isGodMode == true){
			contentLayout = R.layout.content_god;
		}else{
			contentLayout = R.layout.content;
		}
	}
	


	public static boolean isChangedNightMode() {
		return isChangedNightMode;
	}


	public static void setChangedNightMode(boolean isChangedNightMode) {
		Prop.isChangedNightMode = isChangedNightMode;
	}


	public static boolean isConectToNet() {
		return isConnectToNet;
	}


	public static void setConectToNet(boolean isConectToNet) {
		Prop.isConnectToNet = isConectToNet;
	}


	public static boolean isAutoNightMode() {
//		System.out.println("auto night mode id :" + Init.share.getBoolean("AutoNightMode", false));
		return Init.share.getBoolean("AutoNightMode", false);
	}


	public static void setAutoNightMode(boolean isAutoNightMode) {
//		Prop.isAutoNightMode = isAutoNightMode;
		Init.editor.putBoolean("AutoNightMode", isAutoNightMode).commit();
	}


	public static boolean isDisplayImage() {
//		System.out.println("display image is :" + Init.share.getBoolean("AutoNightMode", false));
		return Init.share.getBoolean("DisplayImage", false);
	}
	
	public static void setDisplayImage(boolean isDisplayImage) {
		Init.editor.putBoolean("AutoNightMode", isDisplayImage).commit();
		
	}

	public static boolean isPager(){
		return Init.share.getBoolean("Pager", false);
	}

	public static void setPager(boolean isPager) {
		Init.editor.putBoolean("Pager", isPager).commit();
		
	}


	
	
}
